package com.wwfish.cmsui.modules.sysuser.client;

import com.nexustar.gwt.dashboard.client.MenuBuilder;
import com.nexustar.gwt.dashboard.client.MenuModel;
import com.nexustar.gwt.dashboard.client.PageModel;
import com.wwfish.cms.model.CMSConstants;
import com.wwfish.cmsui.modules.common.client.util.CodesHelper;
import com.wwfish.cmsui.modules.resource.client.ResourceManagePage;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2010-8-7
 * Time: 9:45:19
 * To change this template use File | Settings | File Templates.
 */
public class MenuImpl implements MenuBuilder {
    public List<MenuModel> getMenu() {
        MenuModel menu = new MenuModel("系统人员管理");
        menu.setPages(getPages());
        List result = new ArrayList();
        result.add(menu);
        return result;
    }

    private List getPages() {
        List r = new ArrayList();
//        PageModel rolePage = new PageModel();
//        rolePage.setPageTitle("创建角色");
//        rolePage.setPageId(RolePage.class.getName());
//        r.add(rolePage);
        PageModel roleManagePage = new PageModel();
        roleManagePage.setPageTitle("角色管理");
        roleManagePage.setPageId(RoleManagePage.class.getName());
        r.add(roleManagePage);

        PageModel userPage = new PageModel();
        userPage.setPageTitle("人员管理");
        userPage.setPageId(SysUserManagePage.class.getName());
        r.add(userPage);
        return r;
    }

    public void cacheModelData() {
//        CodesHelper.cacheCodesById(CMSConstants._CODE_RESOURCE_VARIETY_ID);
    }
}